﻿using System;
using System.Collections.Generic;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using System.Diagnostics;


namespace Auction_Boxing_2
{
    public class StateStopped : State
    {

        // Depricated state. Not Supposed to be use. Use StateMoving instead
        // Good Template for a state
        public StateStopped(State state)
        {
            StateName = "stopped";
            this.ATextures = state.StatePlayer.ATextures;
            LoadState(state.StatePlayer, ATextures);

        }

        public override void LoadState(BoxingPlayer player, Dictionary<string, Animation> ATextures)
        {
            this.StatePlayer = player;
            this.PlayerAnimation = ATextures[StateName];
            StatePlayer.isAttacking = false;
            StatePlayer.isHit = false;
            throw new NotImplementedException();
        }

        public override void Initialize()
        {

        }

        public override void HandleMovement()
        {


        }

        public override void HandleDirection()
        {


        }

        public override void Update(GameTime gameTime)
        {

        }

        public override void HandleState()
        {
            //if (StatePlayer.isHit)
                //StatePlayer.InternalState = new StateHit(this, );

            if (StatePlayer.CurrentHealth <= 0)
                StatePlayer.InternalState = new StateDead(this);

            else if (StatePlayer.KeysDown.Contains(KeyPressed.Up) || StatePlayer.KeysDown.Contains(KeyPressed.Down) || StatePlayer.KeysDown.Contains(KeyPressed.Right) || StatePlayer.KeysDown.Contains(KeyPressed.Left))
                StatePlayer.InternalState = new StateMoving(this);

            else if (StatePlayer.KeysDown.Contains(KeyPressed.Up) && StatePlayer.DblJumpTimer.Active)
                StatePlayer.InternalState = new StateJumping(StatePlayer.direction, this);

            else if (StatePlayer.KeysDown.Contains(KeyPressed.Attack0))
                StatePlayer.InternalState = new StateCasting(this, StatePlayer.equippedItems[0]);
            else if (StatePlayer.KeysDown.Contains(KeyPressed.Attack1))
                StatePlayer.InternalState = new StateCasting(this, StatePlayer.equippedItems[1]);
            else if (StatePlayer.KeysDown.Contains(KeyPressed.Attack2))
                StatePlayer.InternalState = new StateCasting(this, StatePlayer.equippedItems[2]);
        }

        public override void Translate(float x, float y)
        {


        }

        public override void HandleCollision(List<BoxingPlayer> Players)
        {

        }



    }
}
